<?php /* Smarty version Smarty-3.1.18, created on 2014-06-08 13:46:06
         compiled from ".\templates\index.tpl" */ ?>
<?php /*%%SmartyHeaderCode:114925394691e9d6841-90856139%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '749422d4cfc3eb5677cf499730392b6accd4d1c7' => 
    array (
      0 => '.\\templates\\index.tpl',
      1 => 1401956105,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '114925394691e9d6841-90856139',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'title' => 0,
    'boolean' => 0,
    'banner' => 0,
    'per' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_5394691eca7889_31371292',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5394691eca7889_31371292')) {function content_5394691eca7889_31371292($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 9999, null, array(), 0);?>

<div id="page">
			<div id="header">
				<a href="#menu-left"></a>
				<?php echo $_smarty_tpl->tpl_vars['title']->value;?>
 - CountSheep
				<a href="#menu-right" class="friends right"></a>
			</div>
			<div id="banner" style="position:relative;display:<?php echo $_smarty_tpl->tpl_vars['boolean']->value;?>
">
			     <a href="<?php echo $_smarty_tpl->tpl_vars['banner']->value['id'];?>
" class="showArticle"><img src="<?php echo $_smarty_tpl->tpl_vars['banner']->value['image'];?>
" /></a>
				 <div id="slider"><span><?php echo $_smarty_tpl->tpl_vars['banner']->value['title'];?>
</span></div>
			</div>
			<div id="content">
			    
				<?php if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['s'])) unset($_smarty_tpl->tpl_vars['smarty']->value['section']['s']);
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['name'] = 's';
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['loop'] = is_array($_loop=$_smarty_tpl->tpl_vars['per']->value) ? count($_loop) : max(0, (int) $_loop); unset($_loop);
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['show'] = true;
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['loop'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['step'] = 1;
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['loop']-1;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['s']['show']) {
    $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['loop'];
    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['s']['total'] == 0)
        $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['show'] = false;
} else
    $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['total'] = 0;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['s']['show']):

            for ($_smarty_tpl->tpl_vars['smarty']->value['section']['s']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['iteration'] = 1;
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['total'];
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['iteration']++):
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['iteration'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['first']      = ($_smarty_tpl->tpl_vars['smarty']->value['section']['s']['iteration'] == 1);
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['last']       = ($_smarty_tpl->tpl_vars['smarty']->value['section']['s']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['total']);
?>
				<div class="block">
				    <div class="left"><a href="<?php echo $_smarty_tpl->tpl_vars['per']->value[$_smarty_tpl->getVariable('smarty')->value['section']['s']['index']]['id'];?>
" class="showArticle"><img src="<?php echo $_smarty_tpl->tpl_vars['per']->value[$_smarty_tpl->getVariable('smarty')->value['section']['s']['index']]['image'];?>
" width="100" height="79" /></a></div>
					<div class="right">
					  <p class="title"><a href="<?php echo $_smarty_tpl->tpl_vars['per']->value[$_smarty_tpl->getVariable('smarty')->value['section']['s']['index']]['id'];?>
" class="showArticle"><?php echo $_smarty_tpl->tpl_vars['per']->value[$_smarty_tpl->getVariable('smarty')->value['section']['s']['index']]['title'];?>
</a></p>
					 <span style="font-size:13px"><?php echo $_smarty_tpl->tpl_vars['per']->value[$_smarty_tpl->getVariable('smarty')->value['section']['s']['index']]['content'];?>
<span>
					  <p class="remark"><span class="catalog"># <?php echo $_smarty_tpl->tpl_vars['per']->value[$_smarty_tpl->getVariable('smarty')->value['section']['s']['index']]['cname'];?>
 #</span><span class="date"><?php echo $_smarty_tpl->tpl_vars['per']->value[$_smarty_tpl->getVariable('smarty')->value['section']['s']['index']]['addDate'];?>
</span></p>
					</div>
				</div>
                <?php endfor; endif; ?>
			</div>

			<form method="get" action="article.php" id="form1">
                 <input type="hidden" name="id" id="aid" />
            </form>
			<nav id="menu-left">
				<ul>
					<li><a href="index.php">首页</a></li>
					<li><a href="web.php?cid=1">HTML / HTML5</a></li>
					<li><a href="web.php?cid=2">CSS （层叠样式表）</a></li>
					<li><a href="web.php?cid=3">JavaScript / jQuery</a></li>
					<li><a href="web.php?cid=4">随笔</a></li>
					<li><a href="web.php?cid=5">转载</a></li>
					<li><a href="web.php?cid=6">笑话集</a></li>
					<li><a href="message.php">留言板</a></li>
					<li><a href="about.php">关于博主</a></li>
				</ul>
			</nav>
			<nav id="menu-right">
				<ul align="center">
					<h2 style="color:#fff;font:bold 18px/25px '微软雅黑';">管理员登录</h2>
							<form id="login">
							<li class="Label">用户名</li>
							<li><input type="text" name="username" id="username" style="width:100%;height:30px;text-align:center;" /></li>

							<li class="Label">密码</li>
							<li><input type="password" name="password" id="password" style="width:100%;height:30px;text-align:center;" /></li>
                            <li>&nbsp;</li>
                            <li><input type="submit" value="登录" name="submit" style="width:100%;height:35px;text-align:center;" /></li>
							</form>				
				</ul>
				<div id="head"></div>
			</nav>
		</div>
<script type="text/javascript">
			//	The menu on the left
			$(function() {
				$('nav#menu-left').mmenu({
					searchfield: false,
					counters: true
				});
			});
			//	The menu on the right
			$(function() {

				$('nav#menu-right').mmenu({
					position: 'right',
					counters: false,
					searchfield: false
				});

				//	Click a menu-item
				var $confirm = $('#confirmation');
				$('#menu-right a').not( '.mmenu-subopen' ).not( '.mmenu-subclose' ).bind(
					'click.example',
					function( e )
					{
						e.preventDefault();
						$confirm.show().text( 'You clicked "' + $(this).text() + '"' );
						$('#menu-right').trigger( 'close' );
					}
				);
			});

          //首页文章摘要
          /*
          var $summary = $('#content .right p.summary').text().substring(0,32);
		  $('#content .right p.summary').text($summary+'...');
          */
          //管理员登录
          $('input[name=submit]').bind('click',function(){
				 if($('#username').val() === '' || $('#password').val() === ''){
				        alert('用户名不得为空');
				 }else{
				     $.ajax({
                           url: 'admin/login.php',
                           type: 'POST',
						   data: $('#login').serialize(),
                           success:function(data){
						        if(data){
								    alert('登陆成功');
                                    window.location.href = 'admin/func.php';
						        }else{
						            alert('用户名或密码错误');
						        }
						}
						});				 
		          };
				  return false;
		  });

          //点击查看文章内容
          $('.showArticle').bind('click',function(){
				var $id = $(this).attr('href');
				$('#aid').val($id);
				$('#form1').submit();
                return false;
		  });
		  
		  //左侧菜单默认选中
		  $('#menu-left ul li:contains(<?php echo $_smarty_tpl->tpl_vars['title']->value;?>
)').addClass('Selected');

		  //banner图片长宽自适应
		  $(function(){
                var bannerWidth = $(window).width();
				if(bannerWidth < 540){
                        $('#banner img').css({
				        	'width':bannerWidth + 'px',
					        'height':bannerWidth * (5/9) + 'px'
					    });
				}else{
				         $('#banner img').css({
					        'width':'540px',
					        'height':'300px'
					     });
				}
				
		  })
</script>
<?php echo $_smarty_tpl->getSubTemplate ("footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 9999, null, array(), 0);?>

<?php }} ?>
